package cn.tedu.spring.config;

import cn.tedu.spring.bean.UserDao;
import cn.tedu.spring.file.Database;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestAppConfig {
    public static void main(String[] args) {
                ApplicationContext context=new AnnotationConfigApplicationContext
                        (AppConfig.class);
         //获取Bean对象      获取(Database)
          Database database = context.getBean(Database.class);
          System.out.println(database);
        //获取Bean对象      获取(userDao)
          UserDao userDao = context.getBean(UserDao.class);
          System.out.println(userDao);
    }
    }


